1. Field of the Invention
This invention relates generally to an image transforming method, especially for transforming YUV4:2:0 color space in an image displaying system.
2. Description of the Prior Art
Generally, human eyes, computer and television using three primary colors, that is: red, green and blue. Originally, to display colors, a displayer should illuminate some luminescence material cover inside of the display. The method for creating color with R, G, B colors is called RGB color space.
Contemporarily, color television system uses YUV color system. The YUV model defines a color space in terms of one luminance and two chrominance components. Y stands for the luminance component (the brightness) and U and V are the chrominance (color) components. YUV is used in the PAL (Phase Alternating Line) and NTSC (National Television Standards Committee) systems of television broadcasting, which is the standard in much of the world. YUV models human perception of color more closely than the standard RGB model used in computer graphics hardware, but not as closely as the HSV color space.
YUV signals are created from an original RGB (red, green and blue) source. The weighted values of R, G and B are added together to produce a single Y signal, representing the overall brightness, or luminance, of that spot. The U signal is then created by subtracting the Y from the blue signal of the original RGB, and then scaling; and V by subtracting the Y from the red, and then scaling by a different factor. This can be accomplished easily with analog circuitry.
The following equations can be used to derive Y, U and V from R, G and B:
      Y    =                  0.299        ⁢                                  ⁢        R            +              0.587        ⁢                                  ⁢        G            +              0.114        ⁢                                  ⁢        B                                          U          =                      0.492            ⁢                                                  ⁢                          (                              B                -                Y                            )                                                                    =                                                    -                0.147                            ⁢                                                          ⁢              R                        -                          0.289              ⁢                                                          ⁢              G                        +                          0.436              ⁢                                                          ⁢              B                                                                        V          =                      0.877            ⁢                                                  ⁢                          (                              R                -                Y                            )                                                                    =                                    0.615              ⁢                                                          ⁢              R                        -                          0.515              ⁢                                                          ⁢              G                        -                          0.100              ⁢                                                          ⁢              B                                          
And, the following equations can be used to derive Y, U and V from R, G and B:R=Y+1.14VG=Y−0.39U−0.58VB=Y+2.03U
Downsampling technology is used for efficiently compressing sampling YUV color space. Chromatic subsampling is to express image with lower color (or chroma) signal resolution than brightness signal. The human eyes are not so sensitive to color than to brightness. The color values of image do not need the same resolution as the brightness resolution. Therefore, many video systems use lower sampling resolution in color channel with respect to brightness channel for decreasing the video signal of the total channel without decreasing the imaging quality apparently. The first value in YCbCr or YPbPr color space stands for brightness(Y), and the two values stand for color sampling amount, wherein the U/Cb is in front of the V/Cr. When comparing the quality of image, the ratio between these three values is more important than the three values, and the brightness value is usually 4.
FIG. 1 shows four YUV4:4:4 pixels, and the data stream is: Y0 U0 V0 Y1 U1 V1 Y2 U2 V2 Y3 U3 V3, which can be implied to four pixels: [Y0 U0 V0] [Y1 U1 V1] [Y2 U2 V2] [Y3 U3 V3]. FIG. 2 shows four YUV4:2:2 pixels, wherein the data stream is: Y0 U0 Y1 V1 Y2 U2 Y3 V3, and implying to four pixels: [Y0 U0 V1] [Y1 U0 V1] [Y2 U2 V3] [Y3 U2 V3]. Most high level video format device uses YUV4:2:2, such as: digital betacam, DVCPRO50, D-9, CCIR601/serial digital interface/D1.
FIG. 3 illustrates four YUV4:1:1 pixels, wherein the data stream is: Y0 U0 Y1 Y2 V2 Y3 and can be implied to four pixels: [Y0 U0 V2] [Y1 U0 V2] [Y2 U0 V2] [Y3 U0 V2]. Some applications use YUV4:1:1, such as: DVCPRO, NTSC DV, DVCAM, D-7.
FIG. 4 shows YUV4:2:0 format pixels, wherein the data stream is: Yo0 Uo0 Yo1 Yo2 Uo2 Yo3/Ye0 Ve0 Ye1 Ye2 Ve2 Ye3, and implying to four pixels: [Yo0 Uo0 Ve0] [Yo1 Uo0 Ve0] [Yo2 Uo2 Ve2] [Yo3 Uo2 Ve2]/[Ye0 Uo0 Ve0] [Ye1 Uo0 Ve0] [Ye2 Uo2 Ve2] [Ye3 Uo2 Ve2]. The YUV4:2:0 is a standard PAL and SECAM (Sequential Couleur Avec Memoire) color system, besides it is a standard I/O format using by video encoder/decoder. The YUV4:2:0 is usually applied in DVD and other main profile application of MPEG-2, PAL DV and DVCAM, JPEG, MJPEG format.
In most image-encoding technology application, the YUV format, especially YUV4:2:0 is used widely for saving storage space. YUV4:2:0 means that only one color value is sample and store in 2:1 sampling rate for each scan line. The adjacent scan line stores different color value. Namely, if a line is 4:2:0, then the next line is 4:0:2, and the next adjacent line is again 4:2:0 . . . etc. The sampling rate in the horizontal and the perpendicular direction for each color value is 2:1, therefore the sampling rate for each color value is 4:1. The YUV4:2:0 is especially suitable for the standard PAL color system and the standard SECAM color system. And most video coder/decoder uses the YUV4:2:0 format for standard input format.
A typical 6×4 RGB image 501 is shown in FIG. 5 which is usually used in computer image application. No matter for RGB1, RGB4, RGB8, RGB565, RGB555, RGB24 or RGB32, each pixel has its independent value, and the order of each pixel imply to the continuous position in the memory. The image 501 can be rotated clockwise 90 degree to a rotated image 502 directly.
The YUV format, except for YUV4:4:4, each pixel has its Y value, and U, V values are dependant to each other between neighbor pixels, therefore it is difficult to rotate image directly. Originally, to rotate YUV format image, the image should be transformed to YUV4:4:4. Then the color space of the image is transformed to RGB by the equation mentioned above. After rotating, the image is transformed back to YUV format. Therefore, it takes longer time to transform YUV format image than RGB format image.
In view of the aforementioned, the present invention provides an improved method of rotating YUV4:2:0 color space for digital video device to overcome the above drawback.